export function debounce(fn, delay) {
    let timer = null;
    return (...args) => {
        if (timer) {
            window.clearTimeout(timer)
        }
        timer = window.setTimeout(() => {
            fn(...args)
        }, delay)
    }
}